package server;

import java.io.IOException;

/**
 *
 */
public class LagouServlet extends HttpServlet {

  @Override
  public void doGet(Request request, Response response) throws IOException {
    String content = "<h1>GoshServlet Get</h1>";
    try {
      response.output(HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  @Override
  public void doPost(Request request, Response response) {
    String content = "<h1>GoshServlet Post</h1>";
    try {
      response.output(HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content);
    } catch (IOException e) {
      e.printStackTrace();
    }
  }

  @Override
  public void init() throws Exception {
  }

  @Override
  public void destroy() throws Exception {
  }
}
